<!-- templates/admin/user/edit_user.html -->
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>修改客户信息</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container mt-5">
    <div class="card shadow-sm">
        <div class="card-header bg-warning text-dark">
            <h4>修改客户信息</h4>
        </div>
        <div class="card-body">
            <form th:action="@{/admin/user/update}" th:object="${customer}" method="post">
                <input type="hidden" th:field="*{customerId}">
                <div class="mb-3">
                    <label class="form-label">客户姓名</label>
                    <input type="text" th:field="*{name}" class="form-control" required>
                </div>
                <div class="mb-3">
                    <label class="form-label">身份证号</label>
                    <input type="text" th:field="*{pid}" class="form-control" required>
                </div>
                <div class="mb-3">
                    <label class="form-label">联系电话</label>
                    <input type="text" th:field="*{telephone}" class="form-control" required>
                </div>
                <div class="mb-3">
                    <label class="form-label">联系地址</label>
                    <input type="text" th:field="*{address}" class="form-control" required>
                </div>
                <div class="mb-3">
                    <label class="form-label">密码</label>
                    <input type="password" th:field="*{password}" class="form-control" required>
                </div>
                <div class="mb-3">
                    <label class="form-label">角色</label>
                    <select th:field="*{role}" class="form-select" required>
                        <option value="ADMIN" th:selected="${customer.role == 'admin'}">管理员</option>
                        <option value="CUSTOMER" th:selected="${customer.role == 'user'}">客户</option>
                    </select>
                </div>
                <button type="submit" class="btn btn-success">保存修改</button>
                <a th:href="@{/admin/customer}" class="btn btn-secondary">取消</a >
            </form>
        </div>
    </div>
</div>
</body>
</html>